package com.zy.explore.design.patterns.responsibilitychain;

import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 检查黑名单过滤器
 *
 * order注解决定了过滤器在责任链中执行的优先级，数值越小，优先级越大
 *
 * @author ZY
 * @date 2021/11/02
 */
@Component
@Order(3)
public class CheckBlackListFilter extends AbstractHandler{
    /**
     * 责任链继续向下处理
     *
     * @param request  请求
     * @param response 响应
     */
    @Override
    public void doFilter(HttpServletRequest request, HttpServletResponse response) {
        System.out.println("做黑名单校验 优先级：3");
    }
}
